# 构建阶段
FROM node:20.18.2 as build-stage
WORKDIR /appweb
COPY package*.json ./
RUN npm install 
COPY . .

# 生成 dist 目录
RUN npm run build  

# 生产阶段
FROM nginx:alpine
COPY --from=build-stage /appweb/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

